<template>
    <el-aside width="180px" class="zc-layout-company-aside">
        <div class="zc-layout-company-aside-warp">
            <el-menu
                    default-active="1"
                    class="zc-layout-company-menu"
                    router
            >
                <Menus :menus="aside.menus"></Menus>
            </el-menu>
        </div>
    </el-aside>
</template>
<script setup type="ts">
import {
    Location,
    Setting,
} from '@element-plus/icons-vue'
import {onMounted, reactive, markRaw} from "vue";
import Menus from "@/views/layouts/core/Menu.vue";

const aside = reactive({
    menus: []
})

const handleOpen = (key, keyPath) => {
    console.log(key, keyPath)
}
const handleClose = (key, keyPath) => {
    console.log(key, keyPath)
}

onMounted(() => {
        aside.menus = [
            {
                id: '0',
                name: '工作台',
                icon: markRaw(Location),
                route: {name: 'companyDesk'},
                isGroup: false
            },
            {
                id: '1',
                name: '待办中心',
                icon: Location,
                route: {name: 'companyDesk'},
                isGroup: false,
                children: [
                    {
                        id: '1-1',
                        name: '我的待办',
                        route: {name: 'companyDesk1'},
                    },
                    {
                        id: '1-2',
                        name: '我的已办',
                        route: {name: 'companyDesk2'},
                    },
                    {
                        id: '1-3',
                        name: '我发起的',
                        route: {name: 'companyDesk3'},
                    },
                    {
                        id: '1-4',
                        name: '知会我的',
                        route: {name: 'companyDesk4'},
                    }
                ]
            },
            {
                id: '2',
                name: '管理中心',
                icon: markRaw(Location),
                route: {name: 'companyDesk'},
                isGroup: true,
                children: [
                    {
                        id: '3',
                        name: '应用管理',
                        icon: markRaw(Location),
                        route: {name: 'companyAppList'}
                    },
                    {
                        id: '4',
                        name: '组织架构',
                        icon: markRaw(Location),
                        route: {name: 'companyAppList2'},
                        children: [
                            {
                                id: '4-1',
                                name: '组织管理',
                                route: {name: 'companyAppList5'},
                            },
                            {
                                id: '4-2',
                                name: '职务职级',
                                route: {name: 'companyAppList3'},
                            },
                            {
                                id: '4-3',
                                name: '成员字段',
                                route: {name: 'companyAppList4'},
                            }
                        ]
                    },
                    {
                        id: '5',
                        name: '平台管理',
                        icon: markRaw(Setting),
                        route: {name: 's1'},
                        children: [
                            {
                                id: '5-1',
                                name: '角色管理',
                                route: {name: 's2'},
                            },
                            {
                                id: '5-2',
                                name: '组件模版',
                                route: {name: 's3'},
                            },
                            {
                                id: '5-3',
                                name: '组件扩展包',
                                route: {name: 's4'},
                            },
                            {
                                id: '5-4',
                                name: '主体管理',
                                route: {name: 's5'},
                            },
                            {
                                id: '5-5',
                                name: '数据字典',
                                route: {name: 's6'},
                            },
                            {
                                id: '5-6',
                                name: '提示词管理',
                                route: {name: 's7'},
                            },
                            {
                                id: '5-7',
                                name: '设置',
                                route: {name: 's7'},
                            }
                        ]
                    }
                ]
            }
        ]
    }
)
</script>
